<?php
/**
 * KePHP, Keep PHP easy!
 */

namespace Gitee\Db\Gitee;

use Ke\Adm\Model;

/**
 * Class Org
 * tableName 'gitee_org'
 *
 * // class properties
 * @property int    $id               主键
 * @property int    $app_id           授权AppID
 * @property int    $gitee_id         GITEE ID
 * @property string $login            组织访问名
 * @property string $name             组织名称
 * @property string $email            邮箱
 * @property string $html_url         网站
 * @property string $enterprise       企业名称
 * @property string $enterprise_name  企业访问名
 * @property int    $gitee_created_at gitee创建时间
 * @property int    $created_at       创建时间
 * @property int    $updated_at       更新时间
 * // class properties
 */
class Org extends Model
{

	protected static $pk = 'id';

	protected static $pkAutoInc = true;

	protected static $tableName = 'gitee_org';

	protected static $columns = [];

	public static function dbColumns()
	{
		// database columns
		return [
			'id'               => ['label' => '主键', 'int' => 1, 'pk' => 1, 'autoInc' => 1],
			'app_id'           => ['label' => '授权AppID', 'int' => 1, 'default' => 0],
			'gitee_id'         => ['label' => 'GITEE ID', 'int' => 1],
			'login'            => ['label' => '组织访问名', 'max' => 32, 'default' => ''],
			'name'             => ['label' => '组织名称', 'max' => 32, 'default' => ''],
			'email'            => ['label' => '邮箱', 'max' => 128, 'default' => ''],
			'html_url'         => ['label' => '网站', 'max' => 128, 'default' => ''],
			'enterprise'       => ['label' => '企业名称', 'max' => 64, 'default' => ''],
			'enterprise_name'  => ['label' => '企业访问名', 'max' => 32, 'default' => ''],
			'gitee_created_at' => ['label' => 'gitee创建时间', 'timestamp' => 1],
			'created_at'       => ['label' => '创建时间', 'timestamp' => 1, self::ON_CREATE => 'now'],
			'updated_at'       => ['label' => '更新时间', 'timestamp' => 1, self::ON_UPDATE => 'now'],
		];
		// database columns
	}

}
